<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%@page import="com.lmpop.trade.tb_commpara.Tb_commparaInfo" %> 
<%@page import="com.lmpop.trade.ti_srccar.*" %>
<%@page import="com.lmpop.trade.ts_area.*" %>
<jsp:useBean id="randomId" class="com.lmpop.frame.util.RandomID" scope="page" />

<%
   	String src_id="";
  	if(request.getParameter("src_id")!=null) src_id = request.getParameter("src_id");
  	Ti_srccarInfo ti_srccarInfo = new Ti_srccarInfo();
  	List list = ti_srccarInfo.getListByPk(src_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String cust_id="",title="",state_code="",src_code="",s_src_type="",s_car_belong="",start_addr="";
	String end_addr="",s_goods_type="",price="",s_end_date="",s_car_type="",car_no="",car_size="",load_num="",contact="",phone="",cellphone="",qq="",msn="",email="",in_date="",user_id="",remark="";
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	if(map.get("title")!=null) title = map.get("title").toString();
  	if(map.get("state_code")!=null) state_code = map.get("state_code").toString();
  	if(map.get("src_code")!=null) src_code = map.get("src_code").toString();
  	if(map.get("src_type")!=null) s_src_type = map.get("src_type").toString();
  	if(map.get("car_belong")!=null) s_car_belong = map.get("car_belong").toString();
  	if(map.get("start_addr")!=null) start_addr = map.get("start_addr").toString();
  	if(map.get("end_addr")!=null) end_addr = map.get("end_addr").toString();
  	if(map.get("goods_type")!=null) s_goods_type = map.get("goods_type").toString();
  	if(map.get("price")!=null) price = map.get("price").toString();
  	if(map.get("end_date")!=null) s_end_date = map.get("end_date").toString();
  	if(map.get("car_type")!=null) s_car_type = map.get("car_type").toString();
  	if(map.get("car_no")!=null) car_no = map.get("car_no").toString();
  	if(map.get("car_size")!=null) car_size = map.get("car_size").toString();
  	if(map.get("load_num")!=null) load_num = map.get("load_num").toString();
  	if(map.get("contact")!=null) contact = map.get("contact").toString();
  	if(map.get("phone")!=null) phone = map.get("phone").toString();
  	if(map.get("cellphone")!=null) cellphone = map.get("cellphone").toString();
  	if(map.get("qq")!=null) qq = map.get("qq").toString();
  	if(map.get("msn")!=null) msn = map.get("msn").toString();
  	if(map.get("email")!=null) email = map.get("email").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("remark")!=null) remark = map.get("remark").toString();
	
	Ts_areaInfo  ts_areaInfo = new Ts_areaInfo();
	Map areaMap = ts_areaInfo.getAreaClass();
	StringBuffer stateareaAttr = new StringBuffer();
	if(!start_addr.equals("")){
	  String areaIds[] = start_addr.split("\\|");	
	  for(String areaId:areaIds){
		 if(areaMap!=null){
			if(areaMap.get(areaId)!=null){
				stateareaAttr.append(areaMap.get(areaId).toString() + " ");
			}                  
		  }                 
	   }		    
	}
	
	StringBuffer endareaAttr = new StringBuffer();
	if(!end_addr.equals("")){
	  String areaIds[] = end_addr.split("\\|");	
	  for(String areaId:areaIds){
		 if(areaMap!=null){
			if(areaMap.get(areaId)!=null){
				endareaAttr.append(areaMap.get(areaId).toString() + " ");
			}                  
		  }                 
	   }		    
	}
	Tb_commparaInfo tb_commparaInfo = new Tb_commparaInfo(); 
	String src_type = tb_commparaInfo.getSelectItem("65",s_src_type); 
    String car_belong = tb_commparaInfo.getSelectItem("66",s_car_belong);  
	String end_date = tb_commparaInfo.getSelectItem("67",s_end_date);
	String car_type = tb_commparaInfo.getSelectItem("58",s_car_type);
	String goods_type = tb_commparaInfo.getSelectItem("68",s_goods_type);




%>


<html>
  <head>
    <title>修改车源</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css" />
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_categoryInfo.js'></script> 
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/interface/Ts_areaInfo.js'></script>
	<script src="js_srcar.js"></script>
</head>

<body>
	<h1>修改车源</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
		<td  colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">车源基本信息</span></td>
	    </tr>
		
		<tr>
			<td align="right" width="20%">
				标题<font color="red">*</font>
			</td>
			
			<td  colspan="3">
			  <input name="title" id="title" type="text" size="60" maxlength ="100" value="<%=title%>"/>
		    </td>
		</tr>
		
		
		<tr>
			<td align="right" width="20%">
				信息编号<font color="red">*</font>
			</td>
			<td  width="18%">
			  <input name="src_code" id="src_code" type="text"  maxlength ="20"  value="<%=src_code%>"/>
			</td>
			<td width="12%" align="right">车源类型<font color="red">*</font></td>
			<td width="60%">
			    <select name="src_type" id="src_type">
				   <option value="">请选择...</option>
				   <%=src_type%>
			   </select>
			</td>
		</tr>
		
		 <tr>
			<td align="right" width="20%">
				车源所属<font color="red">*</font>
			</td>
			<td  width="18%">
			   <select name="car_belong" id="car_belong">
				   <option value="">请选择...</option>
				   <%=car_belong%>
			   </select>
			</td>
			<td width="12%" align="right">载重:</td>
			<td width="60%">
			<input name="load_num" id="load_num" type="text" maxlength ="20"  value="<%=load_num%>" />
			</td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				出发地<font color="red">*</font>
			</td>
			<td  colspan="3">
			   <div id="areaId1" style="display:block;">
					<font color="#CECECE"><%=stateareaAttr%></font>
					<input type="button" class="button_css"name="Submit3" value="重新选择地区" style="cursor:pointer;" onClick="ChangeAreaStyleS();"/>
			</div>
			<div id="areaId2" style="display:none;">
					<select name="startprovince" id="startprovince" onclick="setCitys(this.value,'start')">
					  <option value="">省份</option> 
					</select>
					<select name="starteparchy_code" id="starteparchy_code" onclick="setAreas(this.value,'start')">
					  <option value="">地级市</option> 
					 </select>
					<select name="startcity_code" id="startcity_code" style="display:inline" >
					 <option value="">市、县级市、县</option> 
					</select>
					<input name="start_addr" id="start_addr" value="<%=start_addr%>"  type="hidden" maxlength="30" />			   
				</div>
		    </td>
		</tr>
		
		<tr>
			<td align="right" width="20%">
				目的地<font color="red">*</font>
			</td>
			<td  colspan="3">
			  <div id="areaId3" style="display:block;">
					<font color="#CECECE"><%=endareaAttr%></font>
					<input type="button" class="button_css"name="Submit3" value="重新选择地区" style="cursor:pointer;" onClick="ChangeAreaStyleE();"/>
			</div>
			<div id="areaId4" style="display:none;">
					<select name="endprovince" id="endprovince" onclick="setCitys(this.value,'end')">
					  <option value="">省份</option> 
					</select>
					<select name="endeparchy_code" id="endeparchy_code" onclick="setAreas(this.value,'end')">
					  <option value="">地级市</option> 
					 </select>
					<select name="endcity_code" id="endcity_code" style="display:inline" >
					 <option value="">市、县级市、县</option> 
					</select>
					<input name="end_addr" id="end_addr" value="<%=end_addr%>"  type="hidden" maxlength="30" />			   
				</div></td>
		</tr>
		
	   <tr>
			<td align="right" width="20%">
				承接货物类型:
			</td>
			<td  width="18%">
			  <select name="goods_type" id="goods_type">
				   <option value="">请选择...</option>
				   <%=goods_type%>
			   </select>
			</td>
			<td width="12%" align="right">价格:</td>
			<td width="60%">
			<input name="price" id="price" type="text"  maxlength ="10" value="<%=price%>"/>
			</td>
		</tr>
		
		 <tr>
			<td align="right" width="20%">
				信息截止天数:
			</td>
			<td  width="18%">
			
			 <select name="end_date" id="end_date">
				   <option value="">请选择...</option>
				   <%=end_date%>
			 </select>
			
		
			</td>
			<td width="12%" align="right">车辆类型:</td>
			<td width="60%">
			
			  <select name="car_type" id="car_type">
				   <option value="">请选择...</option>
				   <%=car_type%>
			 </select>
			</td>
		</tr>
		
		
		 <tr>
			<td align="right" width="20%">
				车牌号:
			</td>
			<td  width="18%">
		  <input name="car_no" id="car_no" type="text"  maxlength ="20" value="<%=car_no%>"/>
			</td>
			<td width="12%" align="right">车辆尺寸:</td>
			<td width="60%">
		      <input name="car_size" id="car_size" type="text"  maxlength ="60"  value="<%=car_size%>" />
			</td>
		</tr>
		
			<tr>
		<td  colspan="4">
			   &nbsp;&nbsp;<img src="/program/admin/images/infotip.gif" border="0">&nbsp;&nbsp;<span style="font-size:14px;font-weight:bold;">联系人信息</span></td>
	    </tr>
		
		
		
		<tr>
			<td align="right" width="20%">
				联系人<font color="red">*</font>
			</td>
			<td  width="18%">
		     <input name="contact" id="contact" type="text"  maxlength ="60"  value="<%=contact%>"  />
			</td>
			<td width="12%" align="right">联系电话:</td>
			<td width="60%">
		      <input name="phone" id="phone" type="text"  maxlength ="20"  value="<%=phone%>"   />
			</td>
		</tr>
		
		
		 <tr>
			<td align="right" width="20%">
				手机<font color="red">*</font>
			</td>
			<td  width="18%">
		   <input name="cellphone" id="cellphone" type="text"  maxlength ="20" value="<%=cellphone%>"    />
			</td>
			<td width="12%" align="right">QQ:</td>
			<td width="60%">
		     <input name="qq" id="qq" type="text"  maxlength ="20" value="<%=qq%>"  />
			</td>
		</tr>
		
		
		 <tr>
			<td align="right" width="20%">
				msn:
			</td>
			<td  width="18%">
		       <input name="msn" id="msn" type="text" maxlength ="60"  value="<%=msn%>"  />
			</td>
			<td width="12%" align="right">email:</td>
			<td width="60%">
		       <input name="email" id="email" type="text"  maxlength ="60"  value="<%=email%>"  />
			</td>
		</tr>
		
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="8587" />
				<input type="hidden" name="src_id" value="<%=src_id%>" />
				<input type="hidden" name="cust_id" value="<%=cust_id%>" />
				<input type="hidden" name="state_code" value="<%=state_code%>" />
				<input type="hidden" name="user_id" id="user_id" value="<%=user_id%>" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交"  onclick="subForm()" />&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
<script>
	setstartProvince();
	setendProvince();
</script>